package com.chenfan.mcn.model.dto;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.chenfan.mcn.constant.NumberFormatCst;
import com.chenfan.common.extension.validation.DateTimeString;
import lombok.Data;

import javax.validation.constraints.*;
import java.io.Serializable;
import java.math.BigDecimal;

/**
 * @author: WQ
 * Date 2023/3/29
 * @描述 结算商品导入
 */
@Data
public class SettlementCommodityInputDTO implements Serializable {

    private static final long serialVersionUID = 2531548090008810381L;

    /**
     * 商品ID
     */
    @Excel(name = "*商品ID")
    @NotBlank(message = "【商品ID】必填")
    @Size(max = 20, message = "【商品ID】长度不能超过{max}个字符")
    private String commodityId;

    /**
     * 商品名称
     */
    @Excel(name = "*商品名称")
    @NotBlank(message = "【商品名称】必填")
    @Size(max = 50, message = "【商品名称】长度不能超过{max}个字符")
    private String commodityName;

    /**
     * 店铺名称
     */
    @Excel(name = "*店铺名称")
    @NotBlank(message = "【店铺名称】必填")
    @Size(max = 100, message = "【店铺名称】长度不能超过{max}个字符")
    private String shopName;

    /**
     * 支付月份
     */
    @Excel(name = "*支付月份")
    @NotNull(message = "【支付月份】必填")
    @DateTimeString(message = "【支付月份】录入错误，请参照模板示例", regexp = "^(\\d{4}(-)\\d{2})|(\\d{4}(/)\\d{2})$" , parsePatterns = "yyyy-MM")
    private String payMonthStr;

    /**
     * 主播
     */
    @Excel(name = "*主播")
    @NotNull(message = "【主播】必填")
    private String anchorName;

    /**
     * 佣金比例
     */
    @Excel(name = "*佣金比例", numFormat = NumberFormatCst.PERCENT)
    @NotNull(message = "【佣金比例】必填")
    @DecimalMin(value = "0.00")
    @Digits(integer = 10, fraction = 4, message = "【佣金比例】数值必须大于等于0，其中整数位最多{integer}位，小数位最多{fraction}位")
    private BigDecimal commissionRate;

    /**
     * 结算件数
     */
    @Excel(name = "*结算件数")
    @NotNull(message = "【结算件数】必填")
    @DecimalMin(value = "0.00")
    @Digits(integer = 10, fraction = 2, message = "【结算件数】数值必须大于等于0，其中整数位最多{integer}位，小数位最多{fraction}位")
    private BigDecimal settlementQty;

    /**
     * 结算单价
     */
    @Excel(name = "*结算单价")
    @NotNull(message = "【结算单价】必填")
    @DecimalMin(value = "0.00")
    @Digits(integer = 10, fraction = 2, message = "【结算单价】数值必须大于等于0，其中整数位最多{integer}位，小数位最多{fraction}位")
    private BigDecimal settlementPrice;


    /**
     * *成交金额（结算）
     */
    @Excel(name = "*成交金额（结算）")
    @NotNull(message = "【成交金额（结算）】必填")
    @DecimalMin(value = "0.00")
    @Digits(integer = 10, fraction = 2, message = "【成交金额（结算）】数值必须大于等于0，其中整数位最多{integer}位，小数位最多{fraction}位")
    private BigDecimal realAmount;

    /**
     * 结算金额
     */
    @Excel(name = "*结算金额")
    @NotNull(message = "【结算金额】必填")
    @DecimalMin(value = "0.00")
    @Digits(integer = 10, fraction = 2, message = "【结算金额】数值必须大于等于0，其中整数位最多{integer}位，小数位最多{fraction}位")
    private BigDecimal settlementAmount;

    /**
     * 结算佣金收入-机构
     */
    @Excel(name = "*结算佣金收入-机构")
    @NotNull(message = "【结算佣金收入-机构】必填")
    @DecimalMin(value = "0.00")
    @Digits(integer = 10, fraction = 2, message = "【结算佣金收入-机构】数值必须大于等于0，其中整数位最多{integer}位，小数位最多{fraction}位")
    private BigDecimal settlementCommission;

    /**
     * 备注
     */
    @Excel(name = "备注")
    @Size(max = 300, message = "【备注】长度不能超过{max}个字符")
    private String remark;
}
